<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 简单的算法实现
        var arr = [4,3,2,1]
        var minNum = arr[0]
        for(var i=1;i<arr.length;i++){
            if(minNum>arr[i]){
                minNum=arr[i]
            }
        }
        console.log(minNum);

        // Math.min(...arr) 取最小值
        var arr = [4,3,1]
        console.log(Math.min(...arr));
    </script>
</body>
</html>